<template>
	<view>
		<u-navbar>
			<view class="u-nav-slot" slot="left" :style="{width:`calc(750rpx - 40rpx - ${paddingright})`}">
				<image class="back_icon" @click="back" src="/static/img/back.png" mode=""></image>
				<view class="left">
					<u-search placeholder="搜索你需要购买的商品" :disabled='disabled' :searchIcon='searchIcon' height="73rpx"
						:focus='focus' v-model="keyword" :showAction='false' :clearabled='clearabled'></u-search>
				</view>
			</view>
		</u-navbar>
	</view>
</template>

<script>
	
	export default {
		name: "searchnav",
		props: {
			keyword: {
				type: String,
				default: ''
			},
			clearabled: {
				type: Boolean,
				default: false
			},
			focus: {
				type: Boolean,
				default: false
			},
			searchIcon: {
				type: String,
				default: 'search'
			},
			disabled: {
				type: Boolean,
				default: false
			},
			
		},
		data() {
			return {
				paddingright: 0,
			};
		},
		onReady() {
			this.paddingright=uni.getStorageSync('paddingright')
			console.log(this.paddingright)
		},
		methods:{
			back(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="less">
	.u-nav-slot {
		display: flex;
		align-items: center;
		width: calc(750rpx - 40rpx);
		.back_icon{
			width: 18rpx;
			height: 32rpx;
			margin-right: 26rpx;
		}
		.left {
			width: 100%;
		}
	}
</style>
